package cn.lyz.authority.common.enums;

public enum RespStatusEnum implements RespErrorInfo{
    // 数据操作错误定义
    SUCCESS(200, "成功!"),
    BODY_NOT_MATCH(400,"请求的数据格式不符!"),
    SIGNATURE_NOT_MATCH(401,"请求的数字签名不匹配!"),
    NOT_AUTHENTICATION(403, "未认正!"),
    NOT_ACCESS_PERMISSION(403,"权限不足"),
    NOT_FOUND(404, "未找到该资源!"),
    METHOD_NOT_SUPPORTED(405,"请求方法不支持"),
    TIME_OUT(408,"请求超时"),
    CONFLICT(409,"请求时发生冲突"),
    ERROR(500, "服务器内部错误!"),
    SERVER_BUSY(503,"服务器正忙，请稍后再试!");

    /** 错误码 */
    private final int code;

    /** 错误描述 */
    private final String msg;

    RespStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}

